<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="admin/common/html/tableHead :: tableHead(~{::title},~{::link},~{::style})">

<title th:text=${title}></title>
<!-- 这儿引用单独的css link -->
<!-- Ladda for Bootstrap 3按钮加载进度插件 -->
<link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
<!-- bootstrap-table表单样式 -->
<link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>

<!-- 用户界面自定义css -->
<link th:href="@{/static/admin/user/css/user-add.css}" rel="stylesheet"/>
<link th:href="@{/static/admin/assets/js/iCheck/flat/all.css}" rel="stylesheet">
<link th:href="@{/static/admin/assets/js/iCheck/line/all.css}" rel="stylesheet">
<style type="text/css">
.list222{
	float: left;
	padding-left: 0px;
}
.list222 li{
float: left;
list-style-type:none;
padding-right: 19px;
}
.list222 li div,.list222 li label{
float: left;
list-style-type:none;
}
</style>

</head>

<body>
      	   	      	      	      	      	      	      	      	      
<div class="content-wrap">
	<div class="row">
		<div class="col-sm-12">
			<div class="nest" id="elementClose">
				<div class="">
				</div>
				<div class="body-nest" id="element">
					<div class="panel-body">
						<form  class="form-horizontal m" id="form-edit" th:object="${SysQuartzJob}">
							<input id="id" name="id" type="hidden" th:field="*{id}"/>
						
									<div class="form-group">
										<label class="col-sm-3 control-label ">任务名称：</label>
										<div class="col-sm-8">
											<input class="form-control" type="text" id="jobName" name="jobName" th:value="*{jobName}"/>
										</div>
									</div>

								
									<div class="form-group">
										<label class="col-sm-3 control-label ">任务组名：</label>
										<div class="col-sm-8">
											<select class="form-control" id="jobGroup" name="jobGroup" th:field="*{jobGroup}">
												<option value="DEFAULT">默认</option>
	                							<option value="SYSTEM">系统</option>
											</select>
										</div>
									</div>

								
									<div class="form-group">
										<label class="col-sm-3 control-label ">调用目标字符串：</label>
										<div class="col-sm-8">
											<input class="form-control" type="text" id="invokeTarget" name="invokeTarget" th:value="*{invokeTarget}"/>
										</div>
									</div>

								
									<div class="form-group">
										<label class="col-sm-3 control-label ">cron执行表达式：</label>
										<div class="col-sm-8">
											<input class="form-control" type="text" id="cronExpression" name="cronExpression" th:value="*{cronExpression}"/>
										</div>
									</div>

								
									<div class="form-group">
										<label class="col-sm-3 control-label ">cron计划策略：</label>
										<div class="col-sm-8">
											<input class="form-control" type="hidden" id="hide_misfirePolicy" th:value="*{misfirePolicy}"/>
											<ul class="list222">
												<li><input tabindex="1" value="1" type="radio" id="square-radio-1" name="misfirePolicy"> <label for="square-radio-1">立即执行</label></li>
												<li><input tabindex="2" value="2" type="radio" id="square-radio-2" name="misfirePolicy"> <label for="square-radio-2">执行一次  </label></li>
												<li><input tabindex="3" value="3" type="radio" id="square-radio-3" name="misfirePolicy"> <label for="square-radio-3">放弃执行</label></li>
											</ul>
										</div>
									</div>

								
									<div class="form-group">
										<label class="col-sm-3 control-label ">是否并发执行（0允许 1禁止）：</label>
										<div class="col-sm-8">
											<select class="form-control"  id="concurrent" name="concurrent" th:field="*{concurrent}">
												<option value="0">允许</option>
												<option value="1">禁止</option>
												
											</select>
										</div>
									</div>

								
									<div class="form-group">
										<label class="col-sm-3 control-label ">任务状态（0正常 1暂停）：</label>
										<div class="col-sm-8">
											
											<select class="form-control"  id="status" name="status" th:field="*{status}">
												<option value="0">正常</option>
												<option value="1">暂停</option>
											</select>
										</div>
									</div>

			
									<div class="form-group">
										<div class="form-control-static col-sm-offset-9">
											<button type="submit" class="btn btn-primary">提交</button>
											<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
										</div>
									</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">
   
</div>
<!-- bootstarp 表格 -->
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>

<script type="text/javascript" th:src="@{/static/admin/assets/js/iCheck/jquery.icheck.js}"></script>
<!-- 弹窗 -->
<script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	 $(".MyDate").datetimepicker({
		 	format: "yyyy-mm-dd hh:00:00",
	        startDate: new Date(),
	        autoclose: true,
	        todayBtn: true,
	        language: 'zh-CN',
	        initialDate:new Date(),
	        minView: 1      
	    });
	 //单选标签美化
	 $('input[name="misfirePolicy"]').iCheck({
         checkboxClass: 'icheckbox_flat-red',
         radioClass: 'iradio_flat-red'
     });
	 var val=$('#hide_misfirePolicy').val();
	 $('input[name="misfirePolicy"]').each(function(){
		 var _val=$(this).val();
		 if(val==_val){
			 $(this).iCheck('check');
		 }
		 
	 })
	
	 
})


$("#form-edit").validate({
	submitHandler : function(form) {
		edit();
	}
});

function edit() {
	var dataFormJson = $("#form-edit").serialize();
	$.ajax({
		cache : true,
		type : "POST",
		url : rootPath + "/SysQuartzJobController/edit",
		data : dataFormJson,
		async : false,
		error : function(request) {
			$.modal.alertError("系统错误");
		},
		success : function(data) {
			$.operate.saveSuccess(data);
		}
	});
}
</script>

</body>


</html>
